﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Vds2465Telegrams
{
	internal static class UserDataColl_Helper
	{
		internal static bool IsThisAReportUserDataType(byte userDataType)
		{
			if (
				(userDataType == 0x02)
			|| (userDataType == 0x04)
			|| (userDataType == 0x06)
			|| (userDataType == 0x08)
				|| (userDataType == 0x30)
				|| (userDataType == 0x35)
				)
			{
				return true;
			}
			return false;
		}

		/// <summary>
		/// TODO this method somehow does not belong here ?
		/// </summary>
		/// <param name="userData"></param>
		/// <returns></returns>
		internal static int LengthOfUserDataType(UserData userData)
		{
			int length = 0;
			switch (userData.DataType)
			{
				case UserData.UserData01Priority:
					length = 3;
					break;
				case UserData.UserData02StatusChangeReport2Confirm:
					length = 7;
					break;
				case UserData.UserData03StatusChangeConfirm:
					length = 7;
					break;
				case UserData.UserData04StatusChangeReport:
					length = 7;
					break;
				default:
					// TODO handle error;
					break;
			}

			return length;
		}
	}
}
